<script lang="ts" setup>
import { ref } from 'vue';
const num = ref(2)
const content = ref('查看全部5条评论＞')
let isFlag = ref(false)

function commentClick() {


    if (isFlag.value == false) {
        num.value = 5
        content.value = '收起来'
        isFlag.value = true
    } else {
        num.value = 2
        content.value = '查看全部5条评论＞'
        isFlag.value = false
    }

}

</script>


<template>
    <div class="over">
        <div class="line"></div>

        <div class="comment-detail">
            <div class="picture-detail">
                <van-image
                    src="https://cdn7.axureshop.com/demo2024/2251242/images/%E6%96%87%E7%AB%A0%E6%B8%B8%E8%AE%B0%E8%AF%A6%E6%83%85/u1113.svg" />
                <van-image
                    src="https://cdn7.axureshop.com/demo2024/2251242/images/%E6%96%87%E7%AB%A0%E6%B8%B8%E8%AE%B0%E8%AF%A6%E6%83%85/u1114.svg" />
                <van-image
                    src="https://cdn7.axureshop.com/demo2024/2251242/images/%E6%96%87%E7%AB%A0%E6%B8%B8%E8%AE%B0%E8%AF%A6%E6%83%85/u1115.svg" />
                <van-image
                    src="https://cdn7.axureshop.com/demo2024/2251242/images/%E6%96%87%E7%AB%A0%E6%B8%B8%E8%AE%B0%E8%AF%A6%E6%83%85/u1116.svg" />
                <van-image
                    src="https://cdn7.axureshop.com/demo2024/2251242/images/%E6%96%87%E7%AB%A0%E6%B8%B8%E8%AE%B0%E8%AF%A6%E6%83%85/u1117.svg" />
                <van-image
                    src="https://cdn7.axureshop.com/demo2024/2251242/images/%E6%96%87%E7%AB%A0%E6%B8%B8%E8%AE%B0%E8%AF%A6%E6%83%85/u1118.svg" />
            </div>

            <div class="thumbs-detail">
                <span><van-image
                        src="https://cdn7.axureshop.com/demo2024/2251242/images/%E6%96%87%E7%AB%A0%E6%B8%B8%E8%AE%B0%E8%AF%A6%E6%83%85/u1120.svg" />
                    <span style="color: #333;font-size: 15;padding-left: 5px;">20</span>
                </span>
            </div>
        </div>

        <p>
            <van-image
                src="https://cdn7.axureshop.com/demo2024/2251242/images/%E4%B8%BB%E9%A2%98%E6%99%AF%E7%82%B9%E5%88%97%E8%A1%A8/u545.svg" />
        </p>

        <div class="over-comment">
            <div style="color: #333; font-size: 16px;width: 32px; height: 20px; margin-left: 20px;margin-bottom: 10px;">
                评论
            </div>

            <div v-for="item in num">
                <div class="comment">
                    <div class="left">
                        <van-image
                            src="https://cdn7.axureshop.com/demo2024/2251242/images/%E6%96%87%E7%AB%A0%E6%B8%B8%E8%AE%B0%E8%AF%A6%E6%83%85/u1114.svg" />
                    </div>
                    <div class="right">
                        <p style="color: #333;font-size: 15px;">五行缺钱</p>
                        <p style="color:#999999;">2098-11-25&nbsp; 来自北京</p>
                        <p>线路设计的非常好，谢谢分享</p>
                    </div>
                    <div>
                        <van-image
                            src="https://cdn7.axureshop.com/demo2024/2251242/images/%E6%99%AF%E7%82%B9%E4%B8%BB%E9%A1%B5/u662.svg" />
                    </div>
                </div>
                <van-image class="line-img"
                    src="https://cdn7.axureshop.com/demo2024/2251242/images/%E4%B8%BB%E9%A2%98%E6%99%AF%E7%82%B9%E5%88%97%E8%A1%A8/u545.svg" />


            </div>

            <p><span style="color: #6799F9;font-size:14px;position: relative;left: 75px;" @click="commentClick">{{
                content
                    }}</span></p>

        </div>



    </div>
</template>

<style scoped lang="scss">
.over {
    width: 100%;

    .line {
        width: 100%;
        height: 10px;
        background-color: rgba(247, 247, 247, 1);
        margin-top: 10px;
    }

    .comment-detail {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding-top: 15px;
        padding-left: 10px;
        padding-right: 10px;

        .picture-detail {

            .van-image:nth-child(2) {
                transform: translateX(-10px);
            }

            .van-image:nth-child(3) {
                transform: translateX(-20px);
            }

            .van-image:nth-child(4) {
                transform: translateX(-30px);
            }

            .van-image:nth-child(5) {
                transform: translateX(-40px);
            }

            .van-image:nth-child(6) {
                transform: translateX(-50px);
            }
        }


    }

    .over-comment {
        width: 96%;

        .comment {
            display: flex;
            justify-content: space-between;

            .left {
                margin-left: 20px;
            }

            .right {
                position: relative;
                right: 50px;
                bottom: 8px;
            }
        }
    }

}
</style>